import 'package:flutter/cupertino.dart';

import '../support_files/assets.gen.dart';

extension BackgroudImageExt on Widget {
  Widget backgroud(AssetGenImage image) {
    return Stack(
      children: [
        image.image(
          width: double.infinity,
          height: double.infinity,
          fit: BoxFit.cover,
        ),
        this,
      ],
    );
  }
}

extension BackgroudImageListExt on List<Widget> {
  Widget backgroud(List<AssetGenImage> images) {
    return Stack(
      children: [
        ...images.reversed
            .map((e) => e.image(
                  width: double.infinity,
                  height: double.infinity,
                  fit: BoxFit.cover,
                ))
            .toList(),
        ...this,
      ],
    );
  }
}

mixin GetServiceRest {
  void rest();
}
